<template>
    <a href="/login">登录</a>
    <h2>信息添加</h2>
    <a href="/show">信息显示</a>
    <table class="table">
        <thead>
            <tr>
                <th>房间名称</th>
                <th>
                    <input type="text" v-model="data.hame">
                </th>
            </tr>
            <tr>
                <th>房型</th>
                <th>
                    <select v-model="data.fx">
                        <option value="0">请选择</option>
                        <option value="1">双人床</option>
                        <option value="2">总统套房</option>
                    </select>
                </th>
            </tr>
            <tr>
                <th>房号</th>
                <th>
                    <select v-model="data.fh">
                        <option value="0">请选择</option>
                        <option value="1">1001</option>
                        <option value="2">1002</option>

                    </select>
                </th>
            </tr>
            <tr>
                <th></th>
                <th>
                    <input type="button" value="排房" @click="audd">
                </th>
            </tr>
        </thead>
    </table>
</template>

<script setup lang="ts">
import axios from 'axios';
import { ref } from 'vue';
const data=ref({
  "hid": 0,
  "hame": "",
  "fx": 0,
  "fh": 0
})


const audd=()=>{
    axios.post("https://localhost:7099/api/VS/Add",data.value).then(res=>{
        if(res.data>0)
    {
        alert('添加成功')
    }
    else
    {
        alert('添加失败')
        return;
    }
    })
}
</script>

<style scoped>

</style>